package org.glickr.api.stats

import org.glickr.api.FlickrApiMethod
import groovy.util.slurpersupport.GPathResult

/* ----------------------------------------------------------------------------------------------------
REQUEST: flickr.stats.getPopularPhotos
INFO: List the photos with the most views, comments or favorites

AUTHENTICATION: This method requires authentication with 'read' permission.

ARGUMENTS:
api_key (Required): Your API application key.
date (Optional): Stats will be returned for this date. This should be in either be in YYYY-MM-DD or unix timestamp format.
A day according to Flickr Stats starts at midnight GMT for all users, and timestamps will automatically be rounded down to the start of the day.
If no date is provided, all time view counts will be returned.
sort (Optional): The order in which to sort returned photos. Defaults to views. The possible values are views, comments and favorites.
Other sort options are available through flickr.photos.search.
per_page (Optional): Number of referrers to return per page. If this argument is omitted, it defaults to 25. The maximum allowed value is 100.
page (Optional): The page of results to return. If this argument is omitted, it defaults to 1.

EXAMPLE RESPONSE:
<photos page="2" pages="89" perpage="10" total="881">
  <photo id="2636" owner="47058503995@N01" secret="a123456" server="2" title="test_04" ispublic="1" isfriend="0" isfamily="0">
    <stats views="941" comments="18" favorites="2" />
  </photo>
  <photo id="2635" owner="47058503995@N01" secret="b123456" server="2" title="test_03" ispublic="0" isfriend="1" isfamily="1">
    <stats views="141" comments="1" favorites="2" />
  </photo>
</photos>
This method returns the standard photo list xml.
In addition each photo element contains a <stats> element. This has attributes for the view, comment and favorite counts for the requested day.
To map <photo> elements to urls, please read the url documentation.
---------------------------------------------------------------------------------------------------- */

class statsGetPopularPhotos implements FlickrApiMethod {
    //
    //  API METHOD
    //
    static final String apiMethod = 'flickr.stats.getPopularPhotos'

    //
    //  VALIDATOR
    //

    //
    //  PARAMS
    //

    //
    //  PROCESSOR
    //

    //
    //  ERROR CODES
    //
}